{__NOLAYOUT__}
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<title>忘记密码</title>
	<link rel="stylesheet" href="__CDN__/assets/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="__CDN__/assets/css/index.css">
    <link rel="stylesheet" href="__CDN__/assets/css/swiper.min.css">
	<script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
	<script src="__CDN__/assets/libs/bootstrap/dist/js/bootstrap.min.js"></script>
	<script src="__CDN__/assets/js/detail.js"></script>
	<script src="__CDN__/assets/js/getcode.js"></script>
	<script type="text/javascript">
		function showdivtel(argument) {
			if(document.getElementById('frogetpasw_form_tel').style.display=='none'){
			document.getElementById('frogetpasw_form_tel').style.display='';
			}
			if(document.getElementById('frogetpasw_form_email').style.display==''){
			document.getElementById('frogetpasw_form_email').style.display='none';
			}
			document.getElementById('frogetpasw_way_email').style.borderBottomWidth='0px';
			document.getElementById('frogetpasw_way_tel').style.borderBottomWidth='1.5px';
		}
		function showdivemail(argument) {
			if(document.getElementById('frogetpasw_form_email').style.display=='none'){
			document.getElementById('frogetpasw_form_email').style.display='';
			}
			if(document.getElementById('frogetpasw_form_tel').style.display==''){
			document.getElementById('frogetpasw_form_tel').style.display='none';
			}
			document.getElementById('frogetpasw_way_tel').style.borderBottomWidth='0px';
			document.getElementById('frogetpasw_way_email').style.borderBottomWidth='1.5px';
		}
	</script>

</head>
<body style="background-color: #fff;">
	<div class="frogetpasw_heard">
			<div class="frogetpasw_heard_return">
				<a href="javascript:history.back();"><img src="__CDN__/assets/img/bikebi/return.png"></a>
			</div>
			<div class="frogetpasw_heard_title">
				<p>忘记密码</p>
			</div>
	</div>
	<div class="frogetpasw_way" style="display: none;">
		<div class="container-fluid">
          <div class="row">
           <div class="col-xs-6 frogetpasw_way_tel" id="frogetpasw_way_tel" onclick="showdivtel()">
           	    <span>手机</span>
           </div>
            <div class="col-xs-6 frogetpasw_way_email" id="frogetpasw_way_email" onclick="showdivemail()">
                <span>邮箱</span>
           </div>
          </div>
       </div>
	</div>
	
   <div class="frogetpasw_form_tel" id="frogetpasw_form_tel">
	<div class="frogetpasw_form">
		
		<form id="resetpwd-form" class="form-horizontal form-layer" method="post" action="{:url('api/user/resetpwd')}" onsubmit="return check_form(this);">

			<input type="hidden" name="action" value="resetpwd" />
            <input type="hidden" name="type" value="mobile" />
			<!-- <input type="text" name="account" placeholder="账号" > -->
			<input type="text" name="mobile"  id="mobile" placeholder="手机号码">
			<div class="frogetpasw_code"><input type="text" name="captcha" placeholder="请输入验证码" >
				<a href="javascript:void(0);"  id="getcode" onclick="getCode(this,'resetpwd')"><span>获取验证码</span></a>

				<a id="regetcode" style="display: none;" type="button"><span id="second">60</span><span>秒后重发</span></a>

			</div>
			<div style="width: 100%;height: 30px;"></div>
			<input type="text" name="newpassword" placeholder="设置新登录密码" >
			<input type="text" name="affirmpassword" placeholder="确认新登录密码" >
            <input  class="frogetpasw_submit btn btn-defaul" id='btn' type="submit" value="完成">
		</form>
	</div>
   </div>
    <div class="frogetpasw_form_email" id="frogetpasw_form_email" style="display: none;">
	<div class="frogetpasw_form">
		<form method="post" action="" onsubmit="return check_form(this);">
			<input type="hidden" name="action" value="resetpwd" />
            <input type="hidden" name="type" value="email" />
			<input type="text" name="account" placeholder="账号" >
			<input type="text" name="email" placeholder="电子邮箱">
			<div class="frogetpasw_code"><input type="text" name="captcha" placeholder="请输入验证码" ><a href=""><span>获取验证码</span></a></div>
			<div style="width: 100%;height: 30px;"></div>
			<input type="text" name="newpassword" placeholder="设置新登录密码" >
			<input type="text" name="affirmpassword" placeholder="确认新登录密码" >

            <input  class="frogetpasw_submit btn btn-defaul" id='btn' type="submit" value="完成">
		</form>
	</div>
   </div>

   <script>
   	   function check_form(obj){
          //console.log(obj);
   	   	  //表单验证
   	   	  
          //表单提交
           var url = '{:url("api/user/resetpwd")}';
           var back= '{:url("index/user/login")}';
          $.ajax({
              url:url,
              type:'post',
              data:$(obj).serialize(),
              success:function(res){
                //console.log(res);
                if(res.code==1){
                   alert('密码重置成功');
                   location.href=back;

                }
              },

              dataType:'json'

          });
          
          
   	   	  return false;
   	   }



   </script>
</body>
</html>